package cn.itsource.org.domain;

import cn.itsource.basic.domain.BaseTreeNode;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

/**
 * 部门实体类
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "t_department")
public class Department extends BaseTreeNode<Department> {
    // 部门编号
    @NotBlank(message = "请输入部门编号")
    @Size(min = 3,max = 6,message = "大小在3到6")
    private String sn;
    // 部门名称
    private String name;
    // 部门状态 1启用 0禁用
    private Integer state;
    // 经理id
    @Column(name = "manager_id")
    private Long managerId;
    // 父部门id
    @Column(name = "parent_id")
    private Long parentId;
    // 路径
    @Column(name = "dir_path")
    private String dirPath;
    @Transient
    private String userName;
    @Transient
    private String parentName;
    @Transient
    private Long[] parentIds;

}
